5. Security Commands > 5.6 AT+CPWD   Change Password

5.6
AT+CPWD   Change Password
AT+CPWD allows to define a new password for a password protected <facility> lock function. Each password is a string of digits, the length of which varies with the associated <facility>. The test command returns a list of pairs which represent the available facilities and the maximum length of the associated password. See AT commands AT+CLCK and AT^SLCK for more information on the various lock features.

Specifically the command can be used to
•
•
•
•
To delete a password use the following syntax: at+cpwd=<facility>,<old password>
Syntax
Test Command  
Response(s)
+CPWD:list of supported (<facility>, <password length>)
Write Command  
Response(s)
If the password for the selected <facility> has been invalidated due to too many failed attempts:
Reference(s) 
PIN 
ASC0 
ASC1 
USB 
MUX1 
MUX2 
MUX3 
Charge 
Last 
GSM 07.07

Parameter Description
 
Phone security locks set by client or factory:
Primarily intended for the client to take safety precautions, passwords "SC" (SIM PIN) and "P2" (SIM PIN2) are usually predefined, but can be configured individually. The password for lock facility "PS" may also be factory set.
“SC“
SIM PIN. SIM requests password upon ME power-up and when this lock com­mand is issued.
If incorrectly entered three times, the SIM PUK is required to perform authen­tication. Input of the SIM PUK password is possible only with AT command AT+CPIN or ATD. For further details please refer to Section 5.1.1, What to do if PIN or password authentication fails?.
<password length>: 4 to 8 digits.
“PS“
Phone locked to SIM card. ME requests password when other than current SIM card is inserted.
"PS" lock is frequently referred to as "phone lock", or "device lock". Accord­ingly, the password may be called "phone code" or "device code". The "PS" password is not associated with the PUK of the SIM card. It must be defined before the first use of <facility> "PS" with AT+CLCK.
<password length>: 4 digits.
If incorrectly entered three times, the Master Phone Code is required to lift the lock. This Unblocking procedure is performed with AT+CPWD using the follow­ing parameters: <facility>="PS", <old password>= Master Phone Code (to be obtained from the module manufacturer), and <new password>= the new phone code ("PS" password for lock facility), if desired.
Mind that successful PIN authentication is a prerequisite for use of AT com­mand AT+CPWD. If Pin authentication has not been completed, input of the Master Phone code password is possible only with AT command AT+CPIN or ATD. For further detail please refer to Section 5.1.1, What to do if PIN or pass­word authentication fails?.
Once the Master Phone Code has been acctepted, the mobile is operational, and the "PS" lock is no longer active. If needed it must be set once again with AT+CLCK.
“P2“
SIM PIN 2, e.g. required for authentication with facility lock "FD" (cf. AT+CLCK).
If incorrectly entered three times, the SIM PUK 2 is required to perform authen­tication. Input of the SIM PUK 2 password is possible only with AT command AT+CPIN2 or ATD. For further detail please refer to Section 5.1.1, What to do if PIN or password authentication fails?.
<password length>: 4 to 8 digits.
Factory defined SIM locks:
Typical examples of factory set SIM locks are prepaid phones or network locks, used to restrict the operation of a mobile to a specific provider or operator. The client should be aware that each of these lock types can only be unlocked if the associated password is available. For example, a mobile can be locked to accept only SIM cards from the respective provider, or even one single SIM card. Once a different SIM card is inserted the ME will prompt the client to enter a specific code. This is not the PUK of the SIM card, but usually an 8-digit code which needs to be requested from the provider.
The locks can only be set by the manufacturer and need to be agreed upon between the parties concerned, e.g. provider, operator, distributor etc. on the one side and the manufacturer on the other side. For details contact your local dealer or Siemens AG.
“PF“
Lock Phone to the very First SIM card
“PN“
Network Personalisation
“PU“
Network subset Personalisation
“PP“
Service Provider Personalisation
“PC“
Corporate Personalisation
Supplementary Service Call Barring:
Supplementary Service "Call Barring" allows to specify conditions under which calls will be disallowed by the network.
The availability of the Supplementary Services varies with the network. To benefit from call barring the client will need to subscribe them, though a limited number of call barring types may be included in the basic tariff pack­age.
<password length>: The Network Password needs to be supplied from the network provider or network oper­ator. Usually there is one 4 digit password which applies to all call barring options. For details contact your pro­vider.
“AO“
BAOC (Bar All Outgoing Calls)
“OI“
BOIC (Bar Outgoing International Calls)
“OX“
BOIC-exHC (Bar Outgoing International Calls except to Home Country)
“AI“
BAIC (Bar All Incoming Calls)
“IR“
BIC-Roam (Bar Incoming Calls when Roaming outside the home country)
“AB“
All Barring services
“AG“
All outGoing barring services
“AC“
All inComing barring services
 
4...8
Length of password. The range of permitted length for a password depends on the associated <facility>. It is available from the test command response, or in the description of parameter <facility>.
 
Password specified for the facility.
Parameter <old password> can be ignored if no old password was allocated to the facility.
Take into account that a password may have already been set by factory, or that the service is subject to a pass­word issued by the provider. See notes above or contact provider.
 
New password. Mandatory, if <old password> was an unblocking key (such as the Master Phone Code).


Notes
•
When changing PIN2 (<facility>="P2") it is recommended to check the new state of PIN2 by using the AT+CPIN2 command.
•
In the airplane mode the write command version for the network related <facility> (AO, OI, OX, AI, IR, AB, AG and AC) is not supported. For remaining facilities the command is fully functional then.

Examples

EXAMPLE 1


To change PIN2
 
EXAMPLE 2


To set password used to enable or disable barring of all outgoing calls:
 
Requests the network to change the password for supplementary service "call barring".
Usually this request will affect all barring services, even though the request is issued for Supplementary Service BAOC ("Barring of all outgoing calls") only. Refer to the respective network provider for detail.
EXAMPLE 3


Handling of the "PS" lock password
 
 
EXAMPLE 4


To specify a new "PS" lock password, after the old password was disabled (e.g. after three failed attempts to change the "PS" password): use the master phone code.
CAUTION: THIS TEST SHOULD BE PERFORMED ONLY IF THE CORRECT MASTER PHONE CODE FOR THE INDIVIDUAL ME USED IS DEFINITELY AVAILABLE! Otherwise the module used will be rendered use­less until the correct master phone code is entered!:
 
where 12345678 is the Master Phone Code and 1111 is the new password. You may also use <new password> to restore the former disabled pass­word.
Alternatively, without giving a new password:
 
(where 12345678 is the Master Phone Code). Deac­tivates the present phone lock.